package com.atguigu.gmall.item;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

// 不连接数据库，所以从 IOC 容器中排除 DataSourceAutoConfiguration 类，相当于取消数据源的自动配置
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

// 当前主启动类所在的包是 com.atguigu.gmall.item，但我们希望扫描的是注解里配置的包
@ComponentScan({"com.atguigu.gmall"})

// 启用微服务的注册和发现
@EnableDiscoveryClient

// 启动能够调用 Feign 接口的功能
// basePackages 属性：指定一个包，以准确扫描到 Feign 接口
@EnableFeignClients(basePackages= {"com.atguigu.gmall"})
public class GMallServiceItemMainType {
    public static void main(String[] args) {
        SpringApplication.run(GMallServiceItemMainType.class, args);
    }
}